package com.zhou.cloud.config;

import com.zhou.cloud.entry.DemoHttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @descrition: 生产服务配置
 * @author: zhouyongjun
 * @date: 2022/11/21
 **/
@Configuration
public class ProductConfig {

    @Autowired
    RestTemplate restTemplate;


    //封装 respTemptate 和基础url
    @Bean("productHttpClient")
    public DemoHttpClient productHttpClient() {
        return new DemoHttpClient("http://product-service/",restTemplate);
    }

}
